﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FWMS.DAO
{
    class RukucailiaoChooseDao
    {
        //页面初始化查询数据
        public Bean.RukucailiaoChooseBean rukucailiaoDaoSelectCondition(Bean.RukucailiaoChooseBean bean)
        {
            bool cailiaonameflag = false;
            DB.DBbase dbbase = new DB.DBbase();
            string yuancailiaosql = "";
            string tiaoweiliaosql = "";
            string fuliaosql = "";

            //原材料入库品名查询
            if (bean.Rukustyle == 0)
            {
                yuancailiaosql = "select * from cailiaoguanli where cailiaotype = '原材料'";
                if (dbbase.ExecuteSQL(yuancailiaosql.Trim()))
                {
                    if (dbbase.rows.Length != 0)
                    {
                        bean.Selectresult = dbbase.rows;
                        bean.Resultrow = dbbase.Row_Number;
                    }
                    else
                    {
                        bean.Selectresult = null;
                        bean.Resultrow = 0;
                    }
                }
            }
            //yuancailiaosql = "select * from cailiaoguanli where cailiaotype = '原材料'";
            //tiaoweiliaosql = "select * from cailiaoguanli where cailiaotype = '调味料'";
            //fuliaosql = "select * from cailiaoguanli where cailiaotype = '辅料'";
            return bean;
        }

    }
}
